\section{core::timeout Class Reference}
\label{classcore_1_1timeout}\index{core::timeout@{core::timeout}}
This class provides a timeout-functionality.  


{\tt \#include $<$timeout.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\bf{timeout} (const boost::function0$<$ void $>$ \&f, int sek)
\begin{CompactList}\small\item\em timeout creates a timeout-object. \item\end{CompactList}\item 
\bf{$\sim$timeout} ()\label{classcore_1_1timeout_e260abc2b5e223bd1c466c6f84abc9b3}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
void $\ast$ \bf{timeout\_\-doit} (void $\ast$)
\begin{CompactList}\small\item\em timeout\_\-doit is a helper function, you shouldn't care about this function \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
This class provides a timeout-functionality. 



Definition at line 41 of file timeout.h.

\subsection{Constructor \& Destructor Documentation}
\index{core::timeout@{core::timeout}!timeout@{timeout}}
\index{timeout@{timeout}!core::timeout@{core::timeout}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}core::timeout::timeout (const boost::function0$<$ void $>$ \& {\em f}, int {\em sek})}\label{classcore_1_1timeout_aaf3488e9969e1c26914b5186e5c21f6}


timeout creates a timeout-object. 

This constructor creates a timeout-object. If your callback lasts longer as the duration it will be interrupted. Please mind that your callback-function could be in a non-consistend state after an interruption.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em f}]is the callback which should be called \item[{\em sek}]is the duration, after which the callback should be cancelled \end{description}
\end{Desc}


Definition at line 9 of file timeout.cpp.

\begin{Code}\begin{verbatim}10 : _f(f), _sek(sek)
11 {
12         pthread_t thrd;
13         pthread_create(&thrd, NULL, core::timeout_doit, (void*)this);
14         sleep(_sek);
15         pthread_detach(thrd);
16         pthread_cancel(thrd);
17         pthread_join(thrd, NULL);
18 }
\end{verbatim}\end{Code}




\subsection{Friends And Related Function Documentation}
\index{core::timeout@{core::timeout}!timeout_doit@{timeout\_\-doit}}
\index{timeout_doit@{timeout\_\-doit}!core::timeout@{core::timeout}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ timeout\_\-doit (void $\ast$)\hspace{0.3cm}{\tt  [friend]}}\label{classcore_1_1timeout_ab577acc0a2e57e2abb31ac882de8964}


timeout\_\-doit is a helper function, you shouldn't care about this function 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em timeout}]\end{description}
\end{Desc}


Definition at line 3 of file timeout.cpp.

\begin{Code}\begin{verbatim}4 {
5         core::timeout *t = (core::timeout*) timeout;
6         t->_f();
7 }
\end{verbatim}\end{Code}




The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
core/timeout.h\item 
core/timeout.cpp\end{CompactItemize}
